<!DOCTYPE html>
<html>
    <head>
      <title>test1</title>
      <script src="../jquery-3.5.0.min.js"></script>
      <script src="showModalDialog.js"></script>
      <script src="common.js"></script>
    </head>
    <body style="background: rgb(216, 204, 204);">
      <h1>test1</h1>
      <form action="">
        <p>
          <button id="button" type="button" value="" onclick="show()"> 打开modal test2</button>
          <!-- <button id="button" type="button" value="" onclick="show1()"> 打开alert</button> -->
          <br>
          <span id="result"></span>
        </p>
      </form>
      <script>
        //using async/await
        function show(){
          console.log('show test1')
          let params = {
            name : 'test1',
            value : 'test123'
          }
          let options = {
            width : 800,
            height : 600
          }
          showModal('test2.html',options,params).then(function(res){
            console.log("test1: " +res)
            document.getElementById('result').innerText = "test1: " + res;
          });
          // console.log("test1: " +res)
          // document.getElementById('result').innerText = "test1: " + res;
        }
        function show1(){
          alert('123')
        }
      </script>
    </body>
</html>
